//
//  Contact.m
//  04-集合(二)NSDictionary
//
//  Created by LL.F on 16/7/7.
//  Copyright © 2016年 LL.F. All rights reserved.
//

#import "Contact.h"

@implementation Contact
- (instancetype)initWithName:(NSString *)name phoneNumber:(NSString *)phoneNumber
{

    self = [super init];
    if (self) {
        //初始化方法中, 不要使用set方法赋值, 用下面的等号直接赋值, 因为此时self刚创建
        _name = name;
        _phoneNumber = phoneNumber;
    }
    return self;
}
//系统自带方法(完成自我介绍)
- (NSString *)description
{

    return [NSString stringWithFormat:@"name = %@ phoneNumber = %@ gender = %@ address = %@ groupName = %@ age = %ld", _name, _phoneNumber, _gender, _address, _groupName, _age];
}
-(void)showContact
{

    NSLog(@"%@", self);//调用了上面的系统自带的方法
}
@end
